<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>javascript</title>
</head>
<body>
<p id="demo">我的第一个段落</p>
    <script>
        document.write('hello world!')
        document.write("<h1>Hello World!</h1>")
        document.getElementById("demo").innerHTML="我的第一段 JavaScript";
        var name_01 = 'marry',age=18,email='marry@163.com',address;settings=null,id='16';
        console.log(typeof (age))//在控制台中打印
        console.log(typeof (age-'abc'));
        console.log(isNaN(age));
        console.log(isNaN(id));
        name_01=Number(name_01);
        console.log(name_01);//NaN Number强制转化成数字
        var topval=parseInt('28px');
        var c='abc58';
        console.log(topval-10);
        console.log(parseInt(c));
        console.log(parseInt('0xf',16));
        var d=parseInt('12.34px');
        var e=parseFloat('12.34px');
        console.log(d);
        console.log(e);

        var isChild = false;
        console.log((isChild.toString()));//除0之外的所有数字，转换为布尔型都为true;除''之外的字符，转换为布尔型都为true;null和undefined转换为布尔型为false

        var num1=10;num3=5;num4=++num1+num3;num5=num1++-num3;
        var num2='5';
        console.log(num1*num2)//Number 隐式类型转换
        console.log(num1)//11 //12
        console.log(num4)//16 //5

        var a=10;a=a+5;//a+=5
        var b=20;b%=4;//b=b%4

        var x=10;y='10';
        z=x==y;//值是否相等
        t=x===y;//值和数据类型是否相等
        console.log(z) //true
        console.log(t) //false

        console.log('img' && 30) //30
        console.log(80 && 55) //55
        console.log('hello' && 65 && 'abc')//abc
        console.log(0 && 55)//0
        console.log(55 && true && 10*'abc'); //NaN
        console.log('hello' || 0)//hello
        console.log(99 ||0)//99
        console.log(""||88||0) //88
        console.log(""||0||"abc")//"abc"
        console.log(m||NaN||99) //99
        console.log(""||m); //undefined
    </script>
</body>
</html>